package org.feiye.studyday20;

import java.util.ArrayList;
import java.util.List;

public class SystemTest {
	// System中的方法
	public static void main(String[] args) {
		int a = 10;
		double b = 10.0;
		long start = System.nanoTime();
		a += 10;
		long end = System.nanoTime();
		System.out.println(end - start);
		long start1 = System.nanoTime();
		b += 10.0;
		long end1 = System.nanoTime();
		System.out.println(end1 - start1);

		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>...");
		int[] a1 = new int[] { 1, 3, 5, 6, 34, 45, 34, 5, 3, 5 };
		int[] a2 = new int[30];
		for (int i = 0; i < a1.length; i++) {
			a2[i] = a1[i];
		}
		for (int i : a2) {
			System.out.print(i + "  ");
		}
		System.out.println();
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.");
		System.arraycopy(a1, 0, a2, 0, a1.length);
		for (int i : a2) {
			System.out.print(i + "  ");
		}
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
		List list = new ArrayList();
		list.add("dog");
		list.add("mouse");
		list.add("cat");
		list.add("bird");
		boolean remove = list.remove("cat");
		System.out.println(remove);
		System.out.println(list);
		boolean remove2 = list.remove("pig");
		System.out.println(remove2);
		System.out.println(list);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>");
		Object[] array = list.toArray();
		for (Object object : array) {
			System.out.print(object + "  ");
		}
	}

}
